import time
def read(filename):
    file = open(filename, 'r')
    data = file.readlines()
    return data

m1=read('m1_sorted.txt')
m2=read('m2_reverse.txt')
m3=read('m3_shuffle.txt')
def sort(a):
    f = True
    while f:
        f = False
        for i in range (len(a)-1):
            if a [i] > a[i + 1]:
                a [i], a[i + 1] = a[i + 1], a[i]
                f = True
t0 = time.time()
sort(m1)
t1 = time.time()
print("Время",round((t1-t0)*1000))

t0 = time.time()
sort(m2)
t1 = time.time()
print("Время",round((t1-t0)*1000))

t0 = time.time()
sort(m3)
t1 = time.time()
print("Время",round((t1-t0)*1000))
